﻿define(["require", "exports", "../../Scripts/photoweb/Server"], function(require, exports, Server) {
    var PhotosViewModel = (function () {
        function PhotosViewModel(photos) {
            var _this = this;
            this.photos = photos;
            this.activate = function (albumId) {
                _this.isLoading(true);
                Server.getPhotosInAlbum(albumId, function (response) {
                    _this.isLoading(false);
                    _this.photos(response);
                }, function (err) {
                    _this.isLoading(false);
                    alert(JSON.stringify(err));
                });
            };
            this.photos = ko.observableArray();
            this.isLoading = ko.observable(true);
        }
        return PhotosViewModel;
    })();

    
    return PhotosViewModel;
});
//# sourceMappingURL=photos.js.map
